/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.merchant.service;

import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.wealth.merchant.entity.Merchant;
import com.wealth.merchant.vo.MerchantVO;
import com.wealth.system.entity.User;

import iaas.service.IBaseService;

/**
 * @author chan
 * @version 1.0
 * @since 1.0
 */
public interface IMerchantService extends IBaseService<Merchant>{
	
	/** 保存商户 */
	public void saveMerchant(Merchant merchant,User user) throws Exception;

	/** 批量保存商户 */
	public boolean importFile(MultipartFile file,Long marketid,Long districtid) throws Exception;
	
	/**  查询商户 市场+状态 */
	public List<Merchant> findByMarketIdAndStatus(Long marketId,Integer status);
	
	/**  查询商户 用户 */
	public Merchant getMerchantByUserId(Long userid) throws Exception;
	
	/** 加载商户 */
	public List<MerchantVO> ajaxMerchantVO(Long marketid,Long categoryid,Long districtid,  Integer status, Integer index,Integer offset) throws Exception;

	/** 搜索加载商户 */
	public List<MerchantVO> ajaxSearchMerchantVO(Long marketid,String name,  Integer status, Integer index,Integer offset) throws Exception;

	/** 查询参与打折的商户 */
	public List<Merchant> getDiscountGoods(Integer isDiscount,Long maxid);
	
	/** 查询参与满减的商户 */
	public List<Merchant> getFullcutMerchant(Integer isFullcut,Long maxid);

	public void updateMerchant(Merchant merchant) throws Exception;


	/**
	 * 限天超商户
	 * @param type 1 = 限时抢购 2=天天特价 3=超值折扣
	 * @return
	 */
	public List<Merchant> findMerchantByType(int type);
	
	//删除商户之前的图片
	public void deletePics(Long merchantid)  throws Exception;
	
}

